#include "domnodelist.h"

DomNodeList::DomNodeList()
{
}

void DomNodeList::append(QDomNode node)
{
    nodeVector.append(node);
}

void DomNodeList::append(QDomNodeList list)
{
    for(uint i=0; i<list.length(); i++)
    {
        nodeVector.append(list.item(i));
    }
}

void DomNodeList::append(DomNodeList list)
{
    for(uint i=0; i<list.length(); i++)
    {
        nodeVector.append(list[i]);
    }
}

void DomNodeList::prepend(QDomNode node)
{
    nodeVector.prepend(node);
}

void DomNodeList::prepend(QDomNodeList list)
{
    for(uint i=0; i<list.length(); i++)
    {
        nodeVector.prepend(list.item(i));
    }
}

void DomNodeList::prepend(DomNodeList list)
{
    for(uint i=list.length()-1; i>0; i--)
    {
        nodeVector.prepend(list[i]);
    }
}

void DomNodeList::operator <<(QDomNode node)
{
    append(node);
}

void DomNodeList::operator <<(QDomNodeList list)
{
    append(list);
}

DomNodeList operator +(DomNodeList list, QDomNode node)
{
    DomNodeList result;
    result.append(list);
    result.append(node);
    return result;
}

DomNodeList operator+(DomNodeList list,QDomNodeList qlist)
{
    DomNodeList result;
    result.append(list);
    result.append(qlist);
    return result;
}

void DomNodeList::clear()
{
    nodeVector.clear();
}
